#ifndef SETTING_SERVICE_H
#define SETTING_SERVICE_H

#include <model/setting.h>
#include <QString>

///设置服务
class SettingServiceDao
{
public:
    SettingServiceDao();

    //单例模式
    static SettingServiceDao& instance() {
        static SettingServiceDao instance;
        return instance;
    }

    void extracted(Setting *&setting, QList<Setting *> &settings);
    Setting *getSetting(const QString &key);

    QVariantMap  getAllSettings(const QString &where = "");

    //插入
    bool insertSetting(Setting *setting);

    //更新
    bool updateSetting(Setting *setting);

    //删除
    bool deleteSetting(const QString &key);


};

#endif // SETTING_SERVICE_H
